package villa.tools.mq.views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.ui.part.ViewPart;

public class PrincipalView{
	
	
	private static PrincipalView instancia = null;
	private static ViewPart view = null;
	private TabFolder tf = null;
	
	public void setLayout(FormData formData)
	{
		this.tf.setLayoutData(formData);
		
	}
	private PrincipalView() {
		
	}
	
	public static PrincipalView getInstancia()
	{
		if (instancia==null){
			instancia = new PrincipalView();
		}
		return instancia;
		
	}
	public void setView(ViewPart vp){
		view = vp;
	}
	public TabFolder getTabFolder(){
		return tf;
	}
	
	public void init(Composite parent){
		
		ToolBarView.getInstancia().setBar(view.getViewSite().getActionBars());
		ToolBarView.getInstancia().init();
        
		tf = new TabFolder(parent, SWT.NONE);
		tf.setLayout(new FillLayout());
		
        Actions.loadActionF(tf);
        
        
        
	}
		
	
}

